package com.aiyige.model.enums;

/**
 * Created by xiachao on 2017/11/22.
 */

public enum SubjectEnum {


 //    商品类型ID数组，类型：0-广告，1-图集，2-视频，3-资讯文章，4-专题，**5-教学视频，6-专业课程，7-培训班，8-私教，9-通用商品**，10-教室出租
    TYPE_PHOTO("photo","图集"),
    TYPE_VIDEO("video","视频"),
    TYPE_ARTICLE("article","咨询文章"),
    TYPE_SPECIAL_TOPIC("special_topic","专题"),
    TYPE_VIDEO_COURSE("video_course","教学视频"),
    TYPE_MAJOR_COURSE("major_course","课程"),
    TYPE_TRAINING_COURSE("training_course","培训班"),
    TYPE_PRIVATE_COURSE("private_course","培训班");


    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    private boolean selected;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    private String type;
    private String value;
    SubjectEnum(String type, String value) {
        this.type = type;
        this.value = value;

    }


    /**
     * 根据key获取value
     *
     * @param key
     *            : 键值key
     * @return String
     */
    public static String getValueByKey(String key) {
        SubjectEnum[] enums = SubjectEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getType().equals(key)) {
                return enums[i].getValue();
            }
        }
        return "";
    }


}
